package Solution_5;

import java.util.*;

public class Game {

    /*private static Set<Puke> pukes_1 = new TreeSet<>();
    private static Set<Puke> pukes_2 = new TreeSet<>();
    private static Set<Puke> pukes_3 = new TreeSet<>();
    private static Set<Puke> dipai = new TreeSet<>();
    private static Puke puke = new Puke();*/
    private static List<Puke> pukes_1 = new ArrayList<>();
    private static List<Puke> pukes_2 = new ArrayList<>();
    private static List<Puke> pukes_3 = new ArrayList<>();
    private static List<Puke> dipai = new ArrayList<>();
    private static Puke puke = new Puke();
    /**
     * 发牌
     */
    public static void makePukes(){

        for (int i = 0; i <17;i++){
           // System.out.println("puk1111 第" + i +"张");
            pukes_1.add(Puke.choose());
           // System.out.println("puk2222 第" + i +"张");
            pukes_2.add(Puke.choose());
          //  System.out.println("puk3333 第" + i +"张");
            pukes_3.add(Puke.choose());
        }
        System.out.println(pukes_1.size());
        for (int i = 0;i < 3;i++){
            dipai.add(Puke.choose());
        }

    }
    public static void showALL(){
        System.out.println("\n玩家的牌：：");
        System.out.print("玩家一");
        show(pukes_1);
        System.out.print("玩家二");
        show(pukes_2);
        System.out.print("玩家三");
        show(pukes_3);

        System.out.println("底牌:");
        show(dipai);
    }

    public static void show(List<Puke> puke){
        Collections.sort(puke);
        System.out.print("\n[ ");
        Iterator t = puke.iterator();
        while (t.hasNext()){
            Puke p =(Puke) t.next();
            if(t.hasNext())
            System.out.print(p.getPukeColor() + p.getPukeNumber() + " , ");
            else System.out.print(p.getPukeColor() + p.getPukeNumber() );
        }
        System.out.print(" ]");
        System.out.println();
    }
}
